package dao

import (
	"context"
	"database/sql"
	"time"
)

// DAO is the user data access object
type DAO interface {
	Create(ctx context.Context, obj interface{}) (Entity, error)
	GetByID(ctx context.Context, uuid string) (Entity, error)
	GetMatch(ctx context.Context, filter string, limit [2]int) ([]Entity, error)
	Update(ctx context.Context, uuid string, obj interface{}) (Entity, error)
	Delete(ctx context.Context, uuid string) error
	Count(ctx context.Context, filter string) (int, error)
}

type Entity interface {
	Uuid() string
	CreateAt() time.Time
	UpdateAt() time.Time
	DeleteAt() sql.NullTime
	Value() interface{}
}
